﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RegexBuilder.Interfaces
{
    public interface IRegexBuilder : IRegexBuilderStarter
    {
        /// <summary>
        /// 正向肯定预查
        /// </summary>
        /// <param name="builder">正则建造者</param>
        /// <returns></returns>
        IRegexBuilder LookAheadNegativeAssert(Action<IRegexBuilderStarter> builder);
        /// <summary>
        /// 正向否定预查
        /// </summary>
        /// <param name="builder">正则建造者</param>
        /// <returns></returns>
        IRegexBuilder LookAheadPositiveAssert(Action<IRegexBuilderStarter> builder);
        /// <summary>
        /// 反向肯定预查
        /// </summary>
        /// <param name="builder">正则建造者</param>
        /// <returns></returns>
        IRegexBuilder LookBehindNegativeAssert(Action<IRegexBuilderStarter> builder);
        /// <summary>
        /// 反向否定预查
        /// </summary>
        /// <param name="builder">正则建造者</param>
        /// <returns></returns>
        IRegexBuilder LookBehindPositiveAssert(Action<IRegexBuilderStarter> builder);
        /// <summary>
        /// 贪婪模式，默认为贪婪模式，非贪婪模式下回尽量少的匹配
        /// </summary>
        /// <param name="greedy">是否贪婪</param>
        /// <returns></returns>
        IRegexBuilder SetGreedy(bool greedy = true);
        /// <summary>
        /// 设置匹配数量
        /// </summary>
        /// <param name="least">最少次数</param>
        /// <param name="most">最多次数</param>
        /// <returns></returns>
        IRegexBuilder SetMatchRange(uint? least, uint? most);
        /// <summary>
        /// 设置匹配数量
        /// </summary>
        /// <param name="times">匹配次数</param>
        /// <returns></returns>
        IRegexBuilder SetMatchTimes(uint times);
        /// <summary>
        /// 获取内部正则表达式，不包含头尾标记
        /// </summary>
        /// <returns></returns>
        string GetInerRegex();
    }
}
